#ifndef QBCISCREENCONTROLLERSHELL_H
#define QBCISCREENCONTROLLERSHELL_H

#include "qbciscreencontroller.h"

#include <QHash>
#include <QThread>
#include <QBciSerial>
#include <QLogger>
#include <QPainter>
#include <QBciRender>

class QBciTerminal : public QObject {
  Q_OBJECT
public:
  explicit QBciTerminal(QThread *thread);
  ~QBciTerminal();

public slots:
  void run();

signals:
  void start();
  void stop();
  void quit();
};

class QBciScreenControllerShell : public QBciRender {
  Q_OBJECT
public:
  explicit QBciScreenControllerShell();
  ~QBciScreenControllerShell();

public slots:
  void startSlot();
  void stopSlot();
  void quitSlot();

signals:
  void start();
  void stop();

private:
  QBciScreenController *Controller;
  QBciTerminal *terminal;
  QBciSerial *Serial;

  QThread *terminalThread;

  void startAllThread();
  void stopAllThread();

protected:
    virtual void stylePaint(QPainter* painter) override;

    virtual void setWaveType(WaveType wave) override;

    virtual void setEnableWave(const bool &flag, const int &ID) override;

    virtual void setFreq(const int &ID, const double &freq) override;

    virtual void startFlick() override;

    virtual void stopFlick() override;
};

#endif // QBCISCREENCONTROLLERSHELL_H
